import requests
from urllib.parse import urljoin


def get_cve(cve_id: str):
    # ending with / is necessary
    baseurl = urljoin("https://anas.openanolis.cn/api/portal/v1/cves/", cve_id) + "/"
    query_params = {"page_size": 100, "page_num": 1}
    resp = requests.get(baseurl, params=query_params)
    resp.raise_for_status()
    return resp.json()
